#include <stdio.h>
#include <string.h>
struct stu 
{
    char name[20];
    int count;
} leader[3] = {{"tom",0},{"jack",0},{"lili",0}};

int main()
{
    struct stu *p;
    p = leader;
    int i,j;
    char k[20];
    for(i = 0; i < 10; i++)
    {
        scanf("%s",k);
        for(j = 0;j < 3;j++)
        {
            if(strcmp(k,(p + j) -> name) == 0)
            {
                (p + j) -> count++;
            }
        }
    }
    printf("\n");
    for(i = 0;i < 3;i++)
    {
        printf("%s,%d\n",(p + i) -> name,(p + i) -> count);
    }
    return 0;
}
